from django.db import models


# 平台数据记录
class PlatformLog(models.Model):
    id = models.AutoField(primary_key=True)
    date = models.CharField(max_length=30)  # 日期
    log = models.JSONField()  # 数据

    class Meta:
        db_table = 'platform_log'


def task():
    return []


# 心理咨询医生
class Doctor(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=10)  # 名称
    picture = models.URLField(null=True)  # 照片
    office = models.CharField(max_length=10)  # 科室
    level = models.CharField(max_length=10)  # 职位
    hospital = models.CharField(max_length=20)  # 医院
    serve = models.IntegerField()  # 服务人次
    score = models.FloatField()  # 评分
    intro = models.TextField(null=True)  # 简介
    task = models.JSONField(default=task)  # 咨询记录

    class Meta:
        db_table = 'doctor'
